package com.fun.base;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.view.View;

public class FuncUtil {

	public static void callToSomeone(Context context, View view, String phoneNo) throws Exception{
		Uri number;
		Intent intent;
		
		number = Uri.parse("tel:" + phoneNo);
		intent = new Intent(Intent.ACTION_CALL, number);
		intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
		context.startActivity(intent);
	}
	
	public static void smsToSomeone(Context context, View view, String phoneNo) throws Exception{
		Intent intent = new Intent(Intent.ACTION_SENDTO);
		
		intent.setData(Uri.parse("smsto:" + phoneNo));
		intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
		context.startActivity(intent);
	}
}
